import Taro from '@tarojs/taro'
import type { StorageBase } from 'naive-storage'

export const BaseStorage: StorageBase = {
  getItem(key) {
    return Taro.getStorageSync(key)
  },
  setItem(key, value) {
    Taro.setStorageSync(key, value)
  },
  removeItem(key) {
    Taro.removeStorageSync(key)
  },
}

export function getLsKey(key: string) {
  return [process.env.NODE_ENV, key].join('_')
}
